package org.system.core.controller.monitor;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.system.core.common.Result;
import org.system.core.domain.server.Server;

/**
 * @author baoRoot
 */
@RestController
@Api(tags = {"服务监控模块"})
@RequestMapping("/monitor/server")
public class ServerController {

    private static final Logger logger = LoggerFactory.getLogger(ServerController.class);

    @GetMapping
    @ApiOperation("获取服务器配置")
    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
    public Result<Server> getInfo() throws Exception {
        logger.info("获取服务器配置");
        Server server = new Server();
        server.copyTo();
        return Result.ok(server);
    }

}
